\subsection{Solution 2}
\label{prestudy:suggested:solution2}
The coding matrix, \MATRIX{c}, is multiplied with the source packet vector, \VECTOR{x}, and this results in the network coded packet vector, \VECTOR{p}.
The value of each element in \MATRIX{c}, $c_{ij}$, is limited to the integers 0 and 1. Thus $c_{ij}  \subset \mathbb{F}_2 = \{0, 1\}$, this leads to a field size, $q$, of two. See equation \eqref{eq:nc:solution2}
The coding matrix can be consider as two matrices, respectively $c_{1,1}$ - $c_{t,a}$ denoted \MATRIX{c_I} and $c_{1,a+1}$ - $c_{t,n}$ denoted \MATRIX{c_P}, one containing the I-frame coding coefficients and the other containing P-frame coding coefficients.
These coefficients are randomly generated at runtime. The unequal error protection is incorporated by using two different probabilities, $P_I$ for the I-frame and $P_P$ for the P-frame, to generate the coefficients of the two submatrices. When $P_I$ is higher than $P_P$ more packets from the I-frame than the P-frame will be coded, making the I-frame more protected.
Just as the coding matrix, the source packet vector can be consider as two vectors, respectively $x_{1}$ - $x_{a}$ and $x_{a+1}$ - $x_{n}$ , containing the I-frame and are the P-frame packets.

\subsubsection{Optimizing the transmitter}
The solution does, initially, not require any processing of \MATRIX{c}. However ensuring that a I-frame packet is always transfered will improve the solution, by having more I-frame information send. Furthermore this feature also eliminates the probability of having zero-only rows within \MATRIX{c}.
Ensuring that the packet contains I-frame information can be done finding the sum of the current \MATRIX{c_I} row. If this sum is equal to zero, a 1 must be placed at a random location in the \MATRIX{c_I} current row. This ensures that information about at least one I-frame i coded, regardless of P-frame information and coefficients.

\subsubsection{Optimizing the receiver}
Due to packet loss though the wireless channel, not all packets will be received. This will decrease t, and thereby the dimensions of \MATRIX{c}. If $rank($\MATRIX{c}$) < n$ it's not possible to recover all information, however if $rank($\MATRIX{c_I}$) = a$ it's possible to recover the I-frame.

\begin{align} &
\left[
\begin{array}{c}	
p_{1} \\
p_{2} \\
\vdots \\
p_{t}
\end{array}
\right]
=
\left[
\begin{array}{c}
\left[	
\begin{array}{ccc}	
c_{1,1} & \cdots & c_{1,a} \\
c_{2,1} & \cdots & c_{2,a} \\
\vdots & \ddots & \vdots \\
c_{t,1} & \cdots & c_{t,a}
\end{array}
\right]
\left[
\begin{array}{ccc}	
c_{1,a+1} & \cdots & c_{1,n} \\
c_{2,a+1} & \cdots & c_{2,n} \\
\vdots & \ddots & \vdots \\
c_{t,a+1} & \cdots & c_{t,n}
\end{array}
\right]
\end{array}
\right]
\g
\left[
\begin{array}{c}	
\left[
\begin{array}{c}	
x_{1} \\
\vdots \\
x_{a}
\end{array}
\right] \\
\left[
\begin{array}{c}	
x_{a+1} \\
\vdots \\
x_{n}
\end{array}
\right]
\end{array}
\right]
\label{eq:nc:solution2}
\intertext{Where:}
&\text{n is the number of source packets, also known as generation size} \notag\\
&\text{t is the number of transmissions} \notag\\
&\text{$x_i$ are the source packets} \notag\\
&\text{\MATRIX{c} is the coding matrix, where \MATRIX{c} $\subset \mathbb{R}^{t \times n}$} \notag\\
&\text{$c_{ij}$ are the coding coefficients} \notag\\
&\text{$p_i$ are the resulting network coded packets} \notag
\end{align}
